<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMessageReceiversTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('message_receivers', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string('upload_sn', 32)->index()->comment('上传批次编号');
            $table->bigInteger('template_id')->index()->comment('站内信模板ID');
            $table->bigInteger('receiver_id')->index()->comment('接收人ID');
            $table->string('keyword1', 64)->nullable()->comment('关键字1');
            $table->string('keyword2', 64)->nullable()->comment('关键字2');
            $table->string('keyword3', 64)->nullable()->comment('关键字3');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('message_receivers');
    }
}
